@echo off
echo 正在创建数据可视化菜单...
echo 请输入MySQL密码后按回车键
mysql -u root -p -e "USE ruoyi; INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('数据可视化', 0, 7, 'charts', NULL, 'M', '0', '0', '', 'chart', 'admin', NOW());"
mysql -u root -p -e "USE ruoyi; SET @parentId = LAST_INSERT_ID();"
mysql -u root -p -e "USE ruoyi; INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('折线图', @parentId, 1, 'line-chart', 'charts/line-chart/index', 'C', '0', '0', 'charts:line:list', 'line-chart', 'admin', NOW());"
mysql -u root -p -e "USE ruoyi; INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('饼图', @parentId, 2, 'pie-chart', 'charts/pie-chart/index', 'C', '0', '0', 'charts:pie:list', 'pie-chart', 'admin', NOW());"
mysql -u root -p -e "USE ruoyi; INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('柱状图', @parentId, 3, 'bar-chart', 'charts/bar-chart/index', 'C', '0', '0', 'charts:bar:list', 'bar-chart', 'admin', NOW());"
mysql -u root -p -e "USE ruoyi; INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, menu_type, visible, status, perms, icon, create_by, create_time) VALUES ('雷达图', @parentId, 4, 'raddar-chart', 'charts/raddar-chart/index', 'C', '0', '0', 'charts:raddar:list', 'raddar-chart', 'admin', NOW());"
mysql -u root -p -e "USE ruoyi; INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, menu_id FROM sys_menu WHERE menu_name IN ('数据可视化', '折线图', '饼图', '柱状图', '雷达图');"
echo 菜单创建完成！
pause